﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Media;
using System.IO;
using System.Reflection;
using System.Windows.Forms;

namespace SimpleBomberman
{
    public class Bomb : GameObject
    {
        #region Public Members

        private int _detonationsCounter;

        #endregion Public Members

        #region Properties

        public int DetonationsCounter
        {
            get
            {
                return this._detonationsCounter;
            }
            set
            {
                this._detonationsCounter = value;
            }
        }

        #endregion Properties

        #region Constructors

        public Bomb() : base()
        {
            this._detonationsCounter = 3;
        }
        public Bomb(int x, int y, int length) : base(x, y, length)
        {
            this._detonationsCounter = 3;
        }

        #endregion Constructors

        #region Public Methods

        public override void Draw(Graphics g)
        {
            //------- Black color -------
            //--- Body ---
            g.FillPolygon(System.Drawing.Brushes.Black, new Point[] { 
                new Point(this.X + 7, this.Y + 1), new Point(this.X + 22, this.Y + 1), 
                new Point(this.X + 22, this.Y + 2), new Point(this.X + 24, this.Y + 2), 
                new Point(this.X + 24, this.Y + 4), new Point(this.X + 26, this.Y + 4), 
                new Point(this.X + 26, this.Y + 8), new Point(this.X + 28, this.Y + 8), 
                new Point(this.X + 28, this.Y + 21), new Point(this.X + 26, this.Y + 21), 
                new Point(this.X + 26, this.Y + 25), new Point(this.X + 24, this.Y + 25), 
                new Point(this.X + 24, this.Y + 27), new Point(this.X + 21, this.Y + 27), 
                new Point(this.X + 21, this.Y + 28), new Point(this.X + 8, this.Y + 28), 
                new Point(this.X + 8, this.Y + 27), new Point(this.X + 5, this.Y + 27), 
                new Point(this.X + 5, this.Y + 25), new Point(this.X + 3, this.Y + 25), 
                new Point(this.X + 3, this.Y + 21), new Point(this.X + 1, this.Y + 21), 
                new Point(this.X + 1, this.Y + 8), new Point(this.X + 3, this.Y + 8), 
                new Point(this.X + 3, this.Y + 4), new Point(this.X + 5, this.Y + 4), 
                new Point(this.X + 5, this.Y + 2), new Point(this.X + 7, this.Y + 2)});

            //------- White color -------
            g.FillRectangle(System.Drawing.Brushes.White, this.X + 6, this.Y + 9, 6, 6);
            g.FillRectangle(System.Drawing.Brushes.White, this.X + 9, this.Y + 6, 4, 4);
            g.FillRectangle(System.Drawing.Brushes.White, this.X + 11, this.Y + 4, 4, 2);

            g.FillRectangle(System.Drawing.Brushes.White, this.X + 16, this.Y + 1, 2, 8);
            g.FillRectangle(System.Drawing.Brushes.White, this.X + 17, this.Y + 0, 2, 3);
            g.FillRectangle(System.Drawing.Brushes.White, this.X + 18, this.Y + 0, 7, 2);

            g.FillRectangle(System.Drawing.Brushes.White, this.X + 26, this.Y + 0, 2, 2);
        }

        #endregion Public Methods
    }
}
